
// MainFrm.cpp : implementation of the CMainFrame class
//

#include "stdafx.h"
#include "bdc.h"

#include "MainFrm.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// CMainFrame

IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)

BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
END_MESSAGE_MAP()

// CMainFrame construction/destruction

CMainFrame::CMainFrame()
{
	// TODO: add member initialization code here
}

CMainFrame::~CMainFrame()
{
}

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
	if( !CFrameWnd::PreCreateWindow(cs) )
		return FALSE;
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs 

	cs.style &= ~(WS_MAXIMIZEBOX | WS_THICKFRAME);

	if(cs.hMenu != NULL) {
		DestroyMenu(cs.hMenu);
		cs.hMenu = NULL;
	}

	return TRUE;
}

// CMainFrame diagnostics

#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
	CFrameWnd::AssertValid();
}

void CMainFrame::Dump(CDumpContext& dc) const
{
	CFrameWnd::Dump(dc);
}
#endif //_DEBUG


// CMainFrame message handlers


BOOL CMainFrame::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle , const RECT& rect , CWnd* pParentWnd , LPCTSTR lpszMenuName , DWORD dwExStyle , CCreateContext* pContext)
{
	// TODO: Add your specialized code here and/or call the base class
	BOOL result = CFrameWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, lpszMenuName, dwExStyle, pContext);

	RECT newRect = {0, 0, MAIN_WIDTH, MAIN_HEIGHT};
	CalcWindowRect(&newRect);
	SetWindowPos(NULL, 0, 0, newRect.right - newRect.left, newRect.bottom - newRect.top, SWP_NOMOVE);

	return result;
}
